package com.hupun.mybatis.mapper;

import com.bstek.dorado.data.provider.Page;
import com.hupun.mybatis.pojo.Products;
import com.hupun.mybatis.pojo.ProductsClassification;
import com.hupun.mybatis.pojo.ProductsExample;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Component
public interface ProductsMapper {
	Collection<Products> selectByCodition(@Param("page")Page<Products> page,
			@Param("params")Map<String, Object> params);

	int selectCountByCondition(@Param("params")Map<String, Object> params);
	
	Collection<Products> selectAll(@Param("page")Page<Products> page);
	
	int selectCount(@Param("params")Map<String, Object> params);

	void deleteProduct(Products product);

	Products select(int id);

	void saveAll(@Param("productList") Collection<Products> productList);

	void delAll(@Param("productList") Collection<Products> productList);

	void updateProducts(@Param("productList") Collection<Products> productList);

	void updateBatchProduct(@Param("productList") Collection<Products> productList);


	Collection<Products> getProuductByProductId(@Param("page")
			Page<Products> page, @Param("productId")String productId);
	/*Collection<Products> selectProductAndClassByTopProductId(@Param("page")
	Page<Products> page);*/

	//int selectCountByCondition();

	int selectCountByProductId(@Param("productId")String productId);

	int selectCountByConditionQuery(@Param("params")Map<String, Object> params);
	Collection<Products> selectAllByCodition(@Param("page")Page<Products> page,
			@Param("params")Map<String, Object> params);

	Collection<Products> getProuductByCondition(Page<Products> page,
			String productId);

	void updateByClassId(@Param("productId")String productId,@Param("topId")String topId);

}